const colorList = [{
	x: 0,
	y: 1,
	x2: 0,
	y2: 0,
	colorStops: [{
		offset: 0,
		color: '#3892D3' // 0% 处的颜色
	}, {
		offset: 1,
		color: '#3892D3' // 100% 处的颜色
	}],
}, {
	x: 0,
	y: 1,
	x2: 0,
	y2: 0,
	colorStops: [{
		offset: 0,
		color: '#50C989' // 0% 处的颜色
	}, {
		offset: 1,
		color: '#50C989' // 100% 处的颜色
	}],
}, {
	x: 0,
	y: 1,
	x2: 0,
	y2: 0,
	colorStops: [{
		offset: 0,
		color: '#0DA3D7' // 0% 处的颜色
	}, {
		offset: 1,
		color: '#0DA3D7' // 100% 处的颜色
	}],
}, {
	x: 0,
	y: 1,
	x2: 0,
	y2: 0,
	colorStops: [{
		offset: 0,
		color: '#71D5FB' // 0% 处的颜色
	}, {
		offset: 1,
		color: '#71D5FB' // 100% 处的颜色
	}],
}, {
	x: 0,
	y: 1,
	x2: 0,
	y2: 0,
	colorStops: [{
		offset: 0,
		color: '#a4d7d3' // 0% 处的颜色
	}, {
		offset: 1,
		color: '#a4d7d3' // 100% 处的颜色
	}],
}];

let fgsrwzglOpt = {
	series: [{
		type: 'gauge',
		splitNumber: 4,
		radius: '100%',
		center: ["50%", "90%"],
		startAngle: 180,
		endAngle: 0,
		min: 0,
		max: 100,
		grid:{
			bottom: '0%'
		},
		pointer: {
			width: 1,
			length: "60%",
		},
		axisLine: {
			show: true,
			lineStyle: {
				width: 14,
				color: [
					[0.2, colorList[0]],
					[0.4, colorList[1]],
					[0.6, colorList[2]],
					[0.8, colorList[3]],
					[1, colorList[4]],
				]
			},
		},
		axisLabel: {
			show: false,
			color: "#666",
			fontSize: 16,
			formatter: function(value) {
				return value.toFixed(0);
			},
		}, //刻度标签。
		axisTick: {
			show: false,

		}, //刻度样式            
		splitLine: {
			show: false,
			length: "28%",
			lineStyle: {
				color: "#fff",
				width: 2,
			},
		}, //分隔线样式
		detail: {
			show: false
		},
		title: {
			show: false
		},
		data: [{
			value: 12,
			name: '决策层国际化导向',
			itemStyle: {
				color: '#FF0000',
			},
		}],

	}]
};

for(var i = 1;i <10;i++){
	const value = parseInt(Math.random()*100);
	const targetDom = 'fgsrwzgl' + i;
	
	fgsrwzglOpt.series[0].data[0].value = value;
	$('#' + targetDom +'Rate').text(value + '%')
	$('#' + targetDom +'Zone').text('济徐分公司')
	echarts.init(document.getElementById(targetDom)).setOption(fgsrwzglOpt, true);
}

